<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">

<head>
    <th:block th:include="include :: header('公文详情')"/>
    <th:block th:include="include :: datetimepicker-css"/>
    <th:block th:include="include :: bootstrap-fileinput-css"/>
    <th:block th:include="include :: summernote-css"/>
</head>

<body class="white-bg gray-bg">

<div class="container-div">
    <div class="row">
        <div class="col-sm-12  ">
            <div class="row">
                <div class="ibox-content">
                </div>
                <div class="ibox-content" th:each="file: ${documentFileList}">
                    <ui class="col-sm-10">   <p>[[${file.fileName}]]  </p>           </ui>
                    <ui class="col-sm-2 ">
                        <div class="btn btn-success btn-xs" href="javascript:void(0)" th:onclick="previewFilePage([[${file.fileId}]], [[${file.fileName}]], [[${file.fileUrl}]])"><i class="fa fa-edit"></i>预览</div>
                        <div class="btn btn-info btn-xs" href="javascript:void(0)" th:onclick="downloadFile([[${file.fileId}]])"><i class="fa fa-anchor"></i>下载</div>
                    </ui>
                </div>

                <div class="ibox-content" id = "content">
                    <div class="row">
                        <h1>[[${demeanorArrange.demeanorTitle}]]</h1> <span>[[${createTime}]] &nbsp</span>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>

<!--
<a class="btn btn-success btn-xs" href="javascript:void(0)"  onclick="previewFile(\'' + row.fileId + '\',\'' + row.fileName + '\')"><i class="fa fa-edit"></i>预览</a>

<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="downloadFile(row.fileId )"><i class="fa fa-remove"></i>下载</a>

-->




<th:block th:include="include :: footer"/>

<script th:inline="javascript">

    function downloadFile(value) {
        console.log(value);
        window.location.href = ctx + "common/file/download?fileId=" + value;
    }


    $(function (){
        let val = [[*{demeanorArrange.demeanorContent}]];
        $("#content").append(val);
        // alert(val);
    });


    function previewFilePage (fileId, fileName, fileUrl){
        let val = [[*{demeanorArrange.demeanorCategory}]];
        if (val == 4) {
            //弹框,展示视频
            $.modal.openTab("视频播放","/demeanor/arrange/view/video?url=" + fileUrl );
        }else {
            previewFile(fileId, fileName);
        }
    }



</script>
</body>

</html>